DROP TABLE IF EXISTS jms_ods.yl_lmdm_sys_abnormal_piece;
CREATE EXTERNAL TABLE jms_ods.yl_lmdm_sys_abnormal_piece(
 ID bigint comment "",  --NUMBER(11)
 NAME string comment "异常名称",  --NVARCHAR2(60)
 EN_NAME string comment "异常英文名称",  --NVARCHAR2(60)
 CN_NAME string comment "异常中文名称",  --NVARCHAR2(60)
 COUNTRY_ID smallint comment "所属国家",  --NUMBER(4)
 OPERATOR_TYPE smallint comment "操作类型",  --NUMBER(4)
 CODE string comment "异常编码",  --NVARCHAR2(20)
 DETAILED_DESCRIPTION string comment "详细说明",  --NVARCHAR2(500)
 IS_PRODUCER_ORDER smallint comment "是否触发工单:1是,2否",  --NUMBER(4)
 IS_ENABLE smallint comment "是否启用:1启用,2不启用",  --NUMBER(4)
 IS_DELETE smallint comment "是否删除:1未删除,2已删除",  --NUMBER(4)
 CREATE_BY bigint comment "创建人ID",  --NUMBER(11)
 UPDATE_BY bigint comment "最后更新人ID",  --NUMBER(11)
 CREATE_BY_NAME string comment "创建人名称",  --NVARCHAR2(50)
 UPDATE_BY_NAME string comment "最后修改人名称",  --NVARCHAR2(50)
 CREATE_TIME timestamp comment "创建时间",  --DATE
 UPDATE_TIME timestamp comment "更新时间",  --DATE
 VERSION string comment "版本号",  --NVARCHAR2(10)
 SORT smallint comment "排序",  --NUMBER(4)
 PARENT_ID bigint comment "父id",  --NUMBER(11)
 LEVEL_TYPE tinyint comment "所属级别 1一级 2二级",  --NUMBER(1)
 OP_TYPE string comment "操作类型,1:取件,2:分拨分拣,3:留仓,4:派件"  --NVARCHAR2(20)
 )
 COMMENT '异常类型'
 PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)')
 STORED AS PARQUET
 LOCATION '/dw/hive/jms_ods.db/external/yl_lmdm_sys_abnormal_piece'
 TBLPROPERTIES (
 'discover.partitions'='false',
 'parquet.column.index.access'='true'
 );
MSCK REPAIR TABLE jms_ods.yl_lmdm_sys_abnormal_piece;